<template>
	<view class="notification flex_col al_center">
		<view class="notification_item flex_col al_center"  v-for="(log,index)  in logList" :key="index" @tap="toreporShow(log)" >
			<view class="title_head flex_row al_center">
				<text>{{log.userName}}  提交的日报</text>
			</view>
			<!-- <view class="flex_col mg_tp_50 apply_person">
				<text>提交人ID</text>
				<text>{{log.createrId}}</text>
			</view> -->
			
			<view class="notice_info mg_tp_30 flex_col">
				<!-- <text>日报类型：{{(computedType(log.type)+'汇报')}}</text> -->
				<text>日报类型：{{log.typeName}}</text>
				<text>提交时间：{{log.submitTime}}</text>
			</view>
			<view class="click_txt mg_tp_30">
				<text>点击查看日报详情</text>
			</view>
			
			<view class="bottom_btn flex_row just_center al_center"><text>查看</text></view>
		</view>
	</view>
</template>

<script>
	let _this;
	export default {
		data() {
			return {
				logList:[]
			};
		},
		onLoad() {
			_this=this
			// 获取日报列表
			_this.tempList = uni.getStorageSync('logList')||[]			
			_this.tempList.forEach((item, i) => {
				console.log(JSON.stringify(item))
				if(item.submitTime)
				{
					item.submitTime = this.$utils.format(new Date(item.submitTime), 'yyyy-MM-dd HH:mm:ss');
					_this.logList.push(item)
				}
			});
		},
		methods:
		{
			computedType(type) {
				var name = ''
				if (type == 'pm') {
					name = '下班前'
				} else if (type == 'report') {
					name = '实时'
				} else {
					name = '上班'
				}
				return name
			},
			toreporShow(item) {
				if (item.entityId == null || item.entityId == '') {
					return;
				}
				this.$utils.navto("../report_show/report_show?type=" + item.type + "&id=" + item.entityId)
			},
		}
	}
</script>

<style lang="scss">
@import "@/common/css/main.css";
.notification{
	width: 750rpx;
	min-height: 100vh;
	background-color: #F7F7F7;
}
.notification_item{
	margin-top: 20rpx;
	width: 690rpx;
	background-color: #fff;
	border-radius: 20rpx;
	border: 1px solid #eee;
}
.title_head{
	width: 630rpx;
	height: 80rpx;
	border-bottom: 1px solid #eee;
	text{
		color: #333;
		font-size: 32rpx;
		font-weight: 600;
	}
}
.apply_person{
	width: 630rpx;
	text:nth-child(1){
		color: #333;
		font-size: 32rpx;
		font-weight: 600;
	}
	text:nth-child(2){
		color: #454545;
		font-size: 28rpx;
		font-weight: 500;
		margin-top: 20rpx;
	}
}
.notice_info{
	width: 630rpx;
	text{
		margin-top: 10rpx;
		color: #454545;
		font-size: 28rpx;
		font-weight: 500;
		margin-top: 20rpx;
	}
}
.click_txt{
	width: 630rpx;
	height: 80rpx;
	border-bottom: 1px solid #eee;
	text{
		margin-top: 10rpx;
		color: #2B69E7;
		font-size: 28rpx;
		font-weight: 500;
		margin-top: 20rpx;
	}
}
.bottom_btn{
	margin: 30rpx 0;
	width: 300rpx;
	height: 80rpx;
	border-radius: 40rpx;
	border: 1px solid #eee;
	text{
		font-size: 30rpx;
		color: #454545;
	}
}
</style>
